/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Issam
 */
@Embeddable
public class TraderGradePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "MATRICULE", nullable = false)
    private short matricule;
    @Basic(optional = false)
    @Column(name = "ID_GRADE", nullable = false)
    private short idGrade;

    public TraderGradePK() {
    }

    public TraderGradePK(short matricule, short idGrade) {
        this.matricule = matricule;
        this.idGrade = idGrade;
    }

    public short getMatricule() {
        return matricule;
    }

    public void setMatricule(short matricule) {
        this.matricule = matricule;
    }

    public short getIdGrade() {
        return idGrade;
    }

    public void setIdGrade(short idGrade) {
        this.idGrade = idGrade;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) matricule;
        hash += (int) idGrade;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TraderGradePK)) {
            return false;
        }
        TraderGradePK other = (TraderGradePK) object;
        if (this.matricule != other.matricule) {
            return false;
        }
        if (this.idGrade != other.idGrade) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "test.entities.TraderGradePK[ matricule=" + matricule + ", idGrade=" + idGrade + " ]";
    }
    
}
